package com.sdx.common.service;

import com.sdx.common.entity.DictBusiness;
import org.beetl.sql.core.SQLManager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName CoreDictBusinessService
 * @Description: No Description
 * @author: tanbaocai
 * @date: 2019/3/14 10:14
 */
@Service
public class CoreDictBusinessService {

	private final String SQL = "common.dictBusiness";
	@Resource
	private SQLManager sqlManager;

	/**
	 *
	 * @param dictType 字典类型 1、大学类型，2、模块，3、科目
	 * @return
	 */
	public List<DictBusiness> getDictBusiness(Integer dictType) {
		DictBusiness param = new DictBusiness();
		param.setDictType(dictType);
		List<DictBusiness> list = sqlManager.select(SQL+".selectDictBusiness",DictBusiness.class,param);
		return list;
	}

	/**
	 * 返回科目列表
	 * @return
	 */
	public List<DictBusiness> getSubjects() {
		return getDictBusiness(3);
	}

	/**
	 * 返回模块
	 * @return
	 */
	public List<DictBusiness> getModules() {
		return getDictBusiness(2);
	}


}
